﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace game.mantianxing
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }

        private void UserControl1_Load(object sender, EventArgs e)
        {
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = this.CreateGraphics();

            //
            this.BackColor = Color.Black;

            //

            SolidBrush blackpen = new SolidBrush(Color.White);
            Font font = new Font("楷体GB_2312", 25, FontStyle.Bold);
            Random ra = new Random();

            for (var i = 0; i < 300; i++)
            {
                double x1 = ra.NextDouble() * 750;
                double y1 = ra.NextDouble() * 1134;
                int x = Convert.ToInt32(Math.Round(x1));
                int y = Convert.ToInt32(Math.Round(y1));

                g.DrawString("*", font, blackpen, x, y);
            }

            //
            //blackpen = new SolidBrush(Color.FromName("#f6ee74"));
            blackpen = new SolidBrush(Color.Yellow);
            g.FillEllipse(blackpen, 400, 100, 50, 50);
            blackpen = new SolidBrush(Color.Black);
            g.FillEllipse(blackpen, 380, 80, 50, 50);

            //
            sp_mantianxing sp = new sp_mantianxing();
            sp.graghics = g;
            sp.point = new Point(100, 100);
            sp.width = 400;
            sp.height = 600;
            sp.paint();

            base.OnPaint(e);
        }
    }
}